window.onload = function () {

    // 退出账号
    var quit = document.getElementById("quit")
        quit.onclick = function () {
            var s = confirm('您确定要退出该账号吗?')
                if (s == true) {
                    window.location.href = "z-login.html"
                }
        }

    var btn = document.getElementById('rebtn')
    btn.onclick = function () {
        var oldp = document.getElementById('oldps').value
        var newp = document.getElementById('newp').value
        var np = document.getElementById('np').value

        // var oldp = $('#odlp').val();//获取值
        // var newp = $('#newp').val();
        // var np = $('#np').val();
        if (oldp == '' || newp == '' || np == '') {
            alert('请输入密码')
        } else {
            if (oldp != '123') {
                alert('旧密码错误!')
            } else {
                if (oldp == newp) {
                    alert('新密码不能与旧密码一致哟!')
                } else {
                    if (newp != np) {
                        alert('新密码输入不一致!')
                    } else {
                        alert('修改密码成功,您的密码是' + newp)
                        for(var i=0 ;i<document.getElementsByTagName("input").length-1;i++){
                        document.getElementsByTagName("input")[i].value= ""
                    }}
                }
            }

        }
    }

    var exit=document.getElementById('exit')
    exit.onclick=function(){
        if(confirm('您确定要退出吗?')){
            window.location.href='z-login.html'
        }
    }


}